<?php

include("init_site.php");

include($PBASEDIR . "/classes/fbMySQL.php");
include($PBASEDIR . "/classes/fbTemplate.php");
include($PBASEDIR . "/classes/pastebinNG.php");
include($PBASEDIR . "/includes/geshi_formats.php");
include($PBASEDIR . "/external/bTemplate/bTemplate.php");
include($PBASEDIR . "/external/GeSHi/geshi/geshi.php");

$TEMPLATES = $PBASEDIR . "/templates/";

$dba = new fbMySQL($config['dbserver'], $config['dbuser'], $config['dbpass']);
if($dba == FALSE) {
	die("Error: Cannot connect to database server!");
}

$rtv = $dba->select_db($config['dbname']);
if($rtv == FALSE) {
	die("Error: Cannot select database!");
}
unset($rtv);

$pastebinNG = new pastebinNG($dba);

$pastebinNG->remove_expired_posts();

function stripslashes_recursive($arr) {
	if(is_array($arr)) {
		return array_map('stripslashes_recursive', $arr);
	} else {
		return stripslashes($arr);
	}
}


if(get_magic_quotes_gpc()) {
	$_GET = stripslashes_recursive($_GET);
	$_POST = stripslashes_recursive($_POST);
	$_COOKIE = stripslashes_recursive($_COOKIE);
}

?>